#include "App.h"
#include <iostream>

#include "BreakPointService.h"

App::App()
: bpService(new BreakPointService())
{
}
App::~App(){
    if(bpService != nullptr){
        delete bpService;
        bpService = nullptr;
    }
}


void App::start(){
    bpService->start();
}
void App::stop(){
    bpService->stop();
}

void App::connected(){
    bpService->connected();
}
void App::disconnected(){
    bpService->disconnected();
}

void App::received(){
    bpService->receivedNormalResp("normal_1-0-OK");
    bpService->receivedNormalResp("normal_2-0-OK");
    bpService->receivedNormalResp("normal_3-0-OK");
}

void App::timeout(){
    bpService->timeout(); 
}

void App::run(int argc, char * argv[]){
    start();

    connected();
    bpService->receivedLoginResp("loginrsp-0-OK");

    timeout();
    bpService->receivedBreakPointResp("breakpoint-0-OK");

    received();

    disconnected();
    stop();
}
